package com.smt.modules.app.controller;

import com.smt.modules.app.annotation.Conceptual;
import com.smt.modules.app.utils.ZipOssUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;

/**
 * @author zhangyi
 * @date 2018/11/7 10:02
 */
@Controller
@RequestMapping("/app/fileLoad")
@Api(description = "远程下载压缩文件(客户端接口)",hidden = true)
public class AppZipController {

    @Resource
    private ZipOssUtils zipOssUtils;

    @PostMapping("/loadFile")
    @ApiOperation(value = "下载压缩文件集合",httpMethod = "POST",hidden = true)
    public void loadFile(HttpServletResponse response) throws Exception {
        List<String> fileList = new ArrayList();
//        fileList.add("http://yissmt.oss-cn-hangzhou.aliyuncs.com/file/2018-11-05/44/03dc1981758c43bc9748b1858f893466-新建文本文档.txt");
        fileList.add("http://yissmt.oss-cn-hangzhou.aliyuncs.com/file/2018-11-05/44/16b22bb4d6b2484bb0dcc207cd6f8866-index.js");
        fileList.add("http://yissmt.oss-cn-hangzhou.aliyuncs.com/file/2018-11-05/44/16cc0766b6a342bc8591729ac5db95f6-index.js");
        zipOssUtils.loadFile(fileList,response);
    }
}
